﻿@model bool?
@{
    string prefix = ViewData.TemplateInfo.HtmlFieldPrefix.Replace(ViewData.ModelMetadata.PropertyName, "").Trim('.');
    ViewData.TemplateInfo.HtmlFieldPrefix = prefix;
    var propertyName = ViewData["name"] == null ? ViewData.ModelMetadata.PropertyName : ViewData["name"].ToString();
    var guid = Guid.NewGuid();
    
}
<tr id="tr-@(guid)">
    <th>
        <label class="label-checkbox" for="@ViewData.TemplateInfo.GetFullHtmlFieldId(propertyName)">
            @("Keep content status".Localize())</label>
        <a  class="tooltip-link" title="@("Keep original content publishing status or change into unpublished and decide manually".Localize())"></a>
        @if (!string.IsNullOrEmpty(ViewData.ModelMetadata.Description))
        {
            <a  class="tooltip-link" title="@ViewData.ModelMetadata.Description.Localize()"></a>
        }
    </th>
    <td>
        <ul class="radio-list">
            <li>
                <input type="radio" id="radio-@(guid)-1" value="True" name="@(propertyName)" checked="checked" />
                <label for="radio-@(guid)-1" class="inline">
                    @("Keep content status".Localize())
                </label>
            </li>
            <li>
                <input type="radio" id="radio-@(guid)-2" value="False" name="@(propertyName)" />
                <label for="radio-@(guid)-2" class="inline">
                    @("Decide myself".Localize())
                </label>
            </li>
        </ul>
        @Html.ValidationMessage(ViewData.ModelMetadata, new { name = ViewData["name"] })
    </td>
</tr>
<script language="javascript" type="text/javascript">
    $(function () {
        var tr = $('#tr-@guid'),
        modelVal = '@ViewData.ModelMetadata.Model';
        tr.find('input:radio').filter('[value=' + modelVal + ']').attr('checked', 'checked');
    });
</script>
